package idiolect.core;

import javax.swing.*;
import java.awt.*;

public class Constants {
    public static final String VOWELS = "a\u0251\u0252\u00E6\u025Be\u026A\u0254\u028A\u028C\u0259\u025Coui\u0275\u0268\u0289";
    public static final String CONSONANTS = "bd\u00F0\u02A4fghjklmn\u014B\u03B8prs\u0283t\u02A7vwz\u0292\u0294";
    public static final String DIACRITICS_AND_HELPERS = "\u02C8\u02CC\u02D0.()";
    public static final String TOTAL = VOWELS + CONSONANTS + DIACRITICS_AND_HELPERS;

    public static void main(String[] args) {
        JFrame f = new JFrame("Test");
        f.setContentPane(new JPanel(new GridLayout(0, 1)));
        f.getContentPane().add(makeLabels(VOWELS));
        f.getContentPane().add(makeLabels(CONSONANTS));
        f.getContentPane().add(makeLabels(DIACRITICS_AND_HELPERS));
        f.getContentPane().add(makeLabels(TOTAL));
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }

    static JPanel makeLabels(String text) {
        JPanel p = new JPanel(new GridLayout(1, text.length()));
        for (int i = 0; i < text.length(); i++) {
            JLabel l = new JLabel(""+text.charAt(i));
            l.setToolTipText(""+i + " / " + (int)text.charAt(i));
            l.setFont(l.getFont().deriveFont(26F));
            p.add(l);
        }
        return p;
    }
}
